﻿@model IEnumerable<MediaAdmin.Application.Entities.LocalFileInfo>

@{
    ViewBag.Title = "Index";
}

<h2>Local files</h2>

<table>
    <tr>
        <th>
            file name
        </th>
        <th>
            date
        </th>
        <th>
            size
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Date)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Size)
        </td>
        <td>
            <a href="@Url.Content("~/Content/"+item.Name)">Url</a> |
            @Html.ActionLink("Delete", "Delete", new { item.Path })
        </td>
    </tr>
}

</table>

<br />

<input id="FileGUID" name="FileGUID" type="hidden" value="f632c00b-9b66-4716-8075-79df63b780fb" />
        <input type="file" id="FileUpload1" name="fileUpload1" />

        <script type="text/javascript">
            var UploadUrl = '/Video/AsyncUpload?FileGUID=f632c00b-9b66-4716-8075-79df63b780fb';
            $(function () {
                $("#FileUpload1").makeAsyncUploader({
                    upload_url: UploadUrl,
                    flash_url: '/Content/Flash/swfupload.swf',
                    button_image_url: '/Content/Images/blank-button.png',
                    button_text: '<font face="Helvetica, Arial" size="13pt" color="#ffffff">Upload File</font>',
                    disableDuringUpload: 'input[type="submit"]',
                    file_size_limit: '8024 MB',
                    button_text_top_padding: 2
                });
            });
        </script>

@section scripts
{

    <script type="text/javascript" src="@Url.Content("~/Scripts/uploader/plupload.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/uploader/plupload.html5.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/uploader/plupload.html4.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/uploader/jquery.plupload.queue.js")"></script>

<script type="text/javascript" >
	$("#uploader").pluploadQueue({
		runtimes : 'html5,html4',
		url: '@Url.Action("Upload", new { })',
		max_file_size : '500mb',
		unique_names : false,
	});
</script>
}
